"use strict";

let {getCusFmtTimeDate, getCustomFormatTimeDate} = require("./TimeDate");
let {getAllStorageDevice} = require("./StorageDevice");

/**
 * node模块插件引入器
 * @deprecated
 * */
function nodeModulePluginsObjectBuilder(nodeModulePluginsName) {
    return require(nodeModulePluginsName);
}

/**
 * 获取当前的主机名称*/
function getCurrentHostName() {
    return require('os').hostname();
}

/**
 * 获取当前的主机的IP地址
 * @param ipType 指定获取主机存在的IP地址类型，默认为ipv4
 * @example 获取主机存在的ipv4地址
 * getCurrentHostIPAddress("ipv4")
 * @example 获取主机存在的ipv6地址
 * getCurrentHostIPAddress("ipv6")
 * */
function getCurrentHostIPAddress(ipType) {
    let os = require('os');
    let currentNetworkInterface = os.networkInterfaces();
    let FinalIPAddressItemArray = ["localhost", os.hostname()];
    if (ipType === undefined) {
        ipType = "iPv4";
    }

    function testObj(DetectObject) {
        try {
            if (Object.prototype.toString.call(DetectObject) === "[object Object]") {
                let EmptyObject = true;
                for (let det in DetectObject) {
                    EmptyObject = false;
                    break;
                }
                return EmptyObject;
            } else {
                throw new Error("你传递过来的数据不是对象类型！");
            }
        } catch (e) {
            return undefined;
        }
    }

    function lightCopy(Sources) {
        return Sources;
    }

    switch (Object.prototype.toString.call(ipType)) {
        case "[object String]":
            switch (ipType.toLowerCase()) {
                case "ipv4":
                    switch (Object.prototype.toString.call(currentNetworkInterface)) {
                        case "[object Object]":
                            if (testObj(currentNetworkInterface) === false) {
                                for (let InterfaceName in currentNetworkInterface) {
                                    for (let num in currentNetworkInterface[InterfaceName]) {
                                        let ipType = currentNetworkInterface[InterfaceName][num]["family"];
                                        switch (ipType.toLowerCase()) {
                                            case "ipv4":
                                                FinalIPAddressItemArray.push(lightCopy(currentNetworkInterface[InterfaceName][num]["address"]));
                                                break;
                                        }
                                    }
                                }
                                FinalIPAddressItemArray.push("0.0.0.0");
                            } else {
                                FinalIPAddressItemArray = undefined;
                            }
                            break;
                        default:
                            FinalIPAddressItemArray = undefined;
                    }
                    break;
                case "ipv6":
                    switch (Object.prototype.toString.call(currentNetworkInterface)) {
                        case "[object Object]":
                            if (testObj(currentNetworkInterface) === false) {
                                for (let InterfaceName in currentNetworkInterface) {
                                    for (let num in currentNetworkInterface[InterfaceName]) {
                                        let ipType = currentNetworkInterface[InterfaceName][num]["family"];
                                        switch (ipType.toLowerCase()) {
                                            case "ipv6":
                                                FinalIPAddressItemArray.push(lightCopy(currentNetworkInterface[InterfaceName][num]["address"]));
                                                break;
                                        }
                                    }
                                }
                            } else {
                                FinalIPAddressItemArray = undefined;
                            }
                            break;
                        default:
                            FinalIPAddressItemArray = undefined;
                    }
                    break;
                default:
                    throw new Error("传参仅识别IPV4或IPV6！");
            }
            break;
        default:
            throw new Error("形参仅能接受字符串参数！");
    }
    return FinalIPAddressItemArray;
}

/**
 * 获取当前主机的运行内存信息
 * @param Details_Mode：详细模式，可接受传值为布尔值，默认为False，简要模式。
 * 返回为包含MemTotal（总体运行内存）、MemFree（可用运行内存）
 * 详细模式仅支持Linux 发行版操作系统，返回一个读取“/proc/meminfo”，并简要处理后的数据对象
 * @return Object|undefined
 * */
function RuntimeMemoryInfo(Details_Mode) {
    let extraSystem = require("child_process");
    let os = require("os");
    let data;
    let data1;
    let data2;
    let data3;
    let memoryInfo = undefined;
    if (typeof Details_Mode !== "boolean") {
        Details_Mode = false;
    }

    switch (process.platform) {
        case "linux":
            memoryInfo = {};
            if (Details_Mode) {
                data = extraSystem.execSync("cat /proc/meminfo").toString("utf-8");
                data1 = String(data).split("\n");
                data1.pop();
                data1.forEach((v1, i1, a1) => {
                    data2 = String(v1).split(":");
                    let itemName = String(data2[0]).toString()
                    memoryInfo[itemName] = undefined;
                    data2.shift();
                    data3 = String(data2[0]).split(" ");
                    let emptySymCount = 0;
                    while (true) {
                        try {
                            data3.forEach((v2, i2, a2) => {
                                if (v2 === "") {
                                    emptySymCount++;
                                }
                            });
                            data3.forEach((v2, i2, a2) => {
                                if (v2 === "") {
                                    a2.splice(i2, 1);
                                    emptySymCount--;
                                    throw new Error("");
                                }
                            });
                        } catch (e) {
                            if (emptySymCount === 0) {
                                memoryInfo[itemName] = parseInt(data3[0]);
                                break;
                            } else {
                                emptySymCount = 0;
                            }
                        }
                    }
                });
            } else {
                memoryInfo.MemTotal = parseInt(`${os.totalmem() / 1024}`);
                memoryInfo.MemFree = parseInt(`${os.freemem() / 1024}`);
            }
            break;
        default:
            memoryInfo = {};
            if (Details_Mode) {
                console.warn("警告：非 Linux 系统暂不能使用详细模式。,Warning: Windows NT system cannot use verbose mode for the time being.");
            }
            memoryInfo.MemTotal = parseInt(`${os.totalmem() / 1024}`);
            memoryInfo.MemFree = parseInt(`${os.freemem() / 1024}`);
            break;
    }
    return memoryInfo;
}

/**
 * 端口范围检查器，用于检查端口号数值是否处于标准范围内
 * @param Port 传入需要检查的端口数值，必须是正整数
 * @return boolean
 * */
function portRange(Port) {
    let FinalDetectValue = false;
    if (Object.prototype.toString.call(Port) === "[object Number]" && !isNaN(Port) && isFinite(Port)) {
        if (parseInt(Port) > 1 && parseInt(Port) < 65535) {
            if (!String(Port).includes(".")) {
                FinalDetectValue = true;
            }
        }
    }
    return FinalDetectValue;
}

/**
 * 主机IP地址检查器，用于检测设置的主机IP地址是否符合主机已经获得的IP地址
 * @param Host 传入需要检查的主机名称或IP地址
 * @return boolean
 * */
function hostCheck(Host) {
    let os = require("os");
    let list = ["localhost", "0.0.0.0", os.hostname()];
    let OriginHostIP = os.networkInterfaces();
    for (let item in OriginHostIP) {
        Array(OriginHostIP[item]).forEach((v1, i1, a1) => {
            v1.forEach((v2, i2, a2) => {
                list.push(v2.address);
            })
        })
    }
    return list.includes(Host);
}

/**
 * 可执行程序文件检测
 * @param FullPath 传入需要检测的程序所在的全路径
 * @return boolean
 * */
function isExecProgramDetect(FullPath) {
    let fs = require("fs");
    switch (process.platform) {
        case "linux":
            if (
                fs.existsSync(FullPath)
                &&
                fs.statSync(FullPath).isFile()
                &&
                fs.statSync(FullPath).mode === 33261
            ) {
                return true;
            } else {
                return false;
            }
        case "win32":
            if (
                fs.existsSync(FullPath)
                &&
                fs.statSync(FullPath).isFile()
                &&
                fs.statSync(FullPath).mode === 33206
            ) {
                return true;
            } else {
                return false;
            }
        default:
            return false;
    }
}

/**
 * 获取当前操作系统的显示语言
 * @description 本函数适用于linux发行版，windows XP或以上的windows操作系统的显示语言的选取值。
 * @description linux发行版通过系统环境变量，调用localectl、locale程序获得当前运行的linux系统界面显示的语言。
 * @description windows操作系统通过读取系统注册表查找界面显示语言的选取值、以及安装windows操作系统时的语言显示的定义值。
 * @description 上述操作在当前运行的操作系统上执行失败或无效。默认返回 "en-us" 值
 * @description 此函数暂时仅支持linux发行版、windows操作系统
 * @return string|"en-us"
 * */
function getCurrentDisplayLanguage() {
    var node_process = require("process");
    var child_process = require("child_process");
    var os = require("os");

    function deepCopy(source) {
        var cp1;
        var cp2;
        try {
            cp1 = JSON.stringify(source);
            cp2 = JSON.parse(cp1);
            return cp2;
        } catch (e) {
            return source;
        }
    }

    function EraseMatchArrayItems(sourceArray, needEraseItem, notModifySourceArray) {
        if (typeof notModifySourceArray !== "boolean") {
            notModifySourceArray = false;
        }
        if (Object.prototype.toString.call(sourceArray) !== "[object Array]") {
            throw new Error("sourceArray Argument must be an array");
        }
        if (needEraseItem !== undefined) {
            var final = [];
            var stopLoop = false;
            while (true) {
                var funcResult = undefined;
                try {
                    sourceArray.forEach(function (value, index, array) {
                        switch (typeof needEraseItem) {
                            case "function":
                                if (Object.prototype.toString.call(needEraseItem) === "[object Function]") {
                                    funcResult = needEraseItem(value);
                                    if (funcResult !== undefined) {
                                        if (typeof funcResult === "boolean") {
                                            if (funcResult) {
                                                if (!notModifySourceArray) {
                                                    throw index;
                                                }
                                            } else {
                                                if (notModifySourceArray) {
                                                    final.push(deepCopy(value));
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    throw new Error("is Only Support Not Async Functions!");
                                }
                                break;
                            case "string":
                                if (String(needEraseItem).toString() === String(value).toString()) {
                                    if (!notModifySourceArray) {
                                        throw index;
                                    }
                                } else {
                                    if (notModifySourceArray) {
                                        final.push(deepCopy(value));
                                    }
                                }
                                break;
                            case "number":
                                if (Number(needEraseItem).valueOf() === Number(value).valueOf()) {
                                    if (!notModifySourceArray) {
                                        throw index;
                                    }
                                } else {
                                    if (notModifySourceArray) {
                                        final.push(deepCopy(value));
                                    }
                                }
                                break;
                            default:
                                throw new Error("needEraseItem is Only Support String Or Number Or Functions");
                        }
                    });
                    stopLoop = true;
                } catch (e) {
                    stopLoop = false;
                    sourceArray.splice(e, 1);
                }
                if (stopLoop) {
                    break;
                }
            }
            if (notModifySourceArray) {
                return final;
            } else {
                return undefined;
            }
        } else {
            throw new Error("not Exist need Match Item");
        }
    }

    function dataResultExtract(ResultSource) {
        var sp1 = String(ResultSource).split(os.EOL);
        EraseMatchArrayItems(sp1, "");
        var sp2 = deepCopy(sp1[sp1.length - 1]);
        sp1.pop();
        var sp3 = undefined;
        if (String(sp2).indexOf("\t") >= 0) {
            sp3 = String(sp2).split("\t");
        } else {
            sp3 = String(sp2).split(" ");
        }
        if (String(sp3[0]).indexOf(" ") >= 0) {
            var pns = String(sp3[0]).split(" ");
            EraseMatchArrayItems(pns, "");
            sp3[0] = deepCopy(pns[0]);
        }
        EraseMatchArrayItems(sp3, "");
        var resultObject = {
            path: "",
            name: "",
            type: "",
            value: ""
        }
        resultObject.path = sp1[sp1.length - 1];
        resultObject.name = sp3[0];
        resultObject.type = sp3[1];
        resultObject.value = sp3[sp3.length - 1];
        return resultObject;
    }

    function linux_ProgramResult(ResultSource, stage) {
        var process_result = {lang: "en-us"};
        var stage_tmp1;
        var stage_tmp2;
        var stage_tmp3;
        var stage_tmp4;
        switch (stage) {
            case "localectl":
                stage_tmp1 = String(ResultSource).split(os.EOL);
                EraseMatchArrayItems(stage_tmp1, "");
                stage_tmp1.forEach(function (v1, i1, a1) {
                    var tmps = EraseMatchArrayItems(new Array(...v1), " ", true);
                    a1[i1] = deepCopy(tmps.join(""));
                });
                stage_tmp2 = String(deepCopy(stage_tmp1[0])).split(":");
                stage_tmp3 = String(deepCopy(stage_tmp2[stage_tmp2.length - 1])).split("=");
                stage_tmp4 = String(deepCopy(stage_tmp3[stage_tmp3.length - 1])).split(".");
                stage_tmp4.forEach(function (v1, i1, a1) {
                    if (String(v1).indexOf("_") >= 0) {
                        var ds = String(deepCopy(v1)).split("_");
                        process_result.lang = deepCopy(ds.join("-").toLowerCase());
                    }
                });
                break;
            case "locale":
                stage_tmp1 = String(ResultSource).split(os.EOL);
                EraseMatchArrayItems(stage_tmp1, "");
                stage_tmp2 = String(deepCopy(stage_tmp1[0])).split("=");
                stage_tmp3 = String(deepCopy(stage_tmp2[stage_tmp2.length - 1])).split(".")
                stage_tmp4 = String(deepCopy(stage_tmp3[0])).split("_");
                process_result.lang = String(deepCopy(stage_tmp4.join("-"))).toLowerCase();
                break;
            default:
                throw new Error("Unknowns stage");
        }
        return process_result;
    }

    var win32_languageCode_Tables = [
        {
            "CultureCode": "0x0436",
            "DisplayName": "Afrikaans - South Africa",
            "LanguageCultureName": "af-ZA",
            "iso_639x_value": "AFK"
        },
        {
            "CultureCode": "0x041C",
            "DisplayName": "Albanian - Albania",
            "LanguageCultureName": "sq-AL",
            "iso_639x_value": "SQI"
        },
        {
            "CultureCode": "0x1401",
            "DisplayName": "Arabic - Algeria",
            "LanguageCultureName": "ar-DZ",
            "iso_639x_value": "ARG"
        },
        {
            "CultureCode": "0x3C01",
            "DisplayName": "Arabic - Bahrain",
            "LanguageCultureName": "ar-BH",
            "iso_639x_value": "ARH"
        },
        {
            "CultureCode": "0x0C01",
            "DisplayName": "Arabic - Egypt",
            "LanguageCultureName": "ar-EG",
            "iso_639x_value": "ARE"
        },
        {
            "CultureCode": "0x0801",
            "DisplayName": "Arabic - Iraq",
            "LanguageCultureName": "ar-IQ",
            "iso_639x_value": "ARI"
        },
        {
            "CultureCode": "0x2C01",
            "DisplayName": "Arabic - Jordan",
            "LanguageCultureName": "ar-JO",
            "iso_639x_value": "ARJ"
        },
        {
            "CultureCode": "0x3401",
            "DisplayName": "Arabic - Kuwait",
            "LanguageCultureName": "ar-KW",
            "iso_639x_value": "ARK"
        },
        {
            "CultureCode": "0x3001",
            "DisplayName": "Arabic - Lebanon",
            "LanguageCultureName": "ar-LB",
            "iso_639x_value": "ARB"
        },
        {
            "CultureCode": "0x1001",
            "DisplayName": "Arabic - Libya",
            "LanguageCultureName": "ar-LY",
            "iso_639x_value": "ARL"
        },
        {
            "CultureCode": "0x1801",
            "DisplayName": "Arabic - Morocco",
            "LanguageCultureName": "ar-MA",
            "iso_639x_value": "ARM"
        },
        {
            "CultureCode": "0x2001",
            "DisplayName": "Arabic - Oman",
            "LanguageCultureName": "ar-OM",
            "iso_639x_value": "ARO"
        },
        {
            "CultureCode": "0x4001",
            "DisplayName": "Arabic - Qatar",
            "LanguageCultureName": "ar-QA",
            "iso_639x_value": "ARQ"
        },
        {
            "CultureCode": "0x0401",
            "DisplayName": "Arabic - Saudi Arabia",
            "LanguageCultureName": "ar-SA",
            "iso_639x_value": "ARA"
        },
        {
            "CultureCode": "0x2801",
            "DisplayName": "Arabic - Syria",
            "LanguageCultureName": "ar-SY",
            "iso_639x_value": "ARS"
        },
        {
            "CultureCode": "0x1C01",
            "DisplayName": "Arabic - Tunisia",
            "LanguageCultureName": "ar-TN",
            "iso_639x_value": "ART"
        },
        {
            "CultureCode": "0x3801",
            "DisplayName": "Arabic - United Arab Emirates",
            "LanguageCultureName": "ar-AE",
            "iso_639x_value": "ARU"
        },
        {
            "CultureCode": "0x2401",
            "DisplayName": "Arabic - Yemen",
            "LanguageCultureName": "ar-YE",
            "iso_639x_value": "ARY"
        },
        {
            "CultureCode": "0x042B",
            "DisplayName": "Armenian - Armenia",
            "LanguageCultureName": "hy-AM",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x082C",
            "DisplayName": "Azeri (Cyrillic) - Azerbaijan",
            "LanguageCultureName": "Cy-az-AZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x042C",
            "DisplayName": "Azeri (Latin) - Azerbaijan",
            "LanguageCultureName": "Lt-az-AZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x042D",
            "DisplayName": "Basque - Basque",
            "LanguageCultureName": "eu-ES",
            "iso_639x_value": "EUQ"
        },
        {
            "CultureCode": "0x0423",
            "DisplayName": "Belarusian - Belarus",
            "LanguageCultureName": "be-BY",
            "iso_639x_value": "BEL"
        },
        {
            "CultureCode": "0x0402",
            "DisplayName": "Bulgarian - Bulgaria",
            "LanguageCultureName": "bg-BG",
            "iso_639x_value": "BGR"
        },
        {
            "CultureCode": "0x0403",
            "DisplayName": "Catalan - Catalan",
            "LanguageCultureName": "ca-ES",
            "iso_639x_value": "CAT"
        },
        {
            "CultureCode": "0x0804",
            "DisplayName": "Chinese - China",
            "LanguageCultureName": "zh-CN",
            "iso_639x_value": "CHS"
        },
        {
            "CultureCode": "0x0C04",
            "DisplayName": "Chinese - Hong Kong SAR",
            "LanguageCultureName": "zh-HK",
            "iso_639x_value": "ZHH"
        },
        {
            "CultureCode": "0x1404",
            "DisplayName": "Chinese - Macau SAR",
            "LanguageCultureName": "zh-MO",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x1004",
            "DisplayName": "Chinese - Singapore",
            "LanguageCultureName": "zh-SG",
            "iso_639x_value": "ZHI"
        },
        {
            "CultureCode": "0x0404",
            "DisplayName": "Chinese - Taiwan",
            "LanguageCultureName": "zh-TW",
            "iso_639x_value": "CHT"
        },
        {
            "CultureCode": "0x0004",
            "DisplayName": "Chinese (Simplified)",
            "LanguageCultureName": "zh-CHS",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x7C04",
            "DisplayName": "Chinese (Traditional)",
            "LanguageCultureName": "zh-CHT",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x041A",
            "DisplayName": "Croatian - Croatia",
            "LanguageCultureName": "hr-HR",
            "iso_639x_value": "HRV"
        },
        {
            "CultureCode": "0x0405",
            "DisplayName": "Czech - Czech Republic",
            "LanguageCultureName": "cs-CZ",
            "iso_639x_value": "CSY"
        },
        {
            "CultureCode": "0x0406",
            "DisplayName": "Danish - Denmark",
            "LanguageCultureName": "da-DK",
            "iso_639x_value": "DAN"
        },
        {
            "CultureCode": "0x0465",
            "DisplayName": "Dhivehi - Maldives",
            "LanguageCultureName": "div-MV",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0813",
            "DisplayName": "Dutch - Belgium",
            "LanguageCultureName": "nl-BE",
            "iso_639x_value": "NLB"
        },
        {
            "CultureCode": "0x0413",
            "DisplayName": "Dutch - The Netherlands",
            "LanguageCultureName": "nl-NL",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0C09",
            "DisplayName": "English - Australia",
            "LanguageCultureName": "en-AU",
            "iso_639x_value": "ENA"
        },
        {
            "CultureCode": "0x2809",
            "DisplayName": "English - Belize",
            "LanguageCultureName": "en-BZ",
            "iso_639x_value": "ENL"
        },
        {
            "CultureCode": "0x1009",
            "DisplayName": "English - Canada",
            "LanguageCultureName": "en-CA",
            "iso_639x_value": "ENC"
        },
        {
            "CultureCode": "0x2409",
            "DisplayName": "English - Caribbean",
            "LanguageCultureName": "en-CB",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x1809",
            "DisplayName": "English - Ireland",
            "LanguageCultureName": "en-IE",
            "iso_639x_value": "ENI"
        },
        {
            "CultureCode": "0x2009",
            "DisplayName": "English - Jamaica",
            "LanguageCultureName": "en-JM",
            "iso_639x_value": "ENJ"
        },
        {
            "CultureCode": "0x1409",
            "DisplayName": "English - New Zealand",
            "LanguageCultureName": "en-NZ",
            "iso_639x_value": "ENZ"
        },
        {
            "CultureCode": "0x3409",
            "DisplayName": "English - Philippines",
            "LanguageCultureName": "en-PH",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x1C09",
            "DisplayName": "English - South Africa",
            "LanguageCultureName": "en-ZA",
            "iso_639x_value": "ENS"
        },
        {
            "CultureCode": "0x2C09",
            "DisplayName": "English - Trinidad and Tobago",
            "LanguageCultureName": "en-TT",
            "iso_639x_value": "ENT"
        },
        {
            "CultureCode": "0x0809",
            "DisplayName": "English - United Kingdom",
            "LanguageCultureName": "en-GB",
            "iso_639x_value": "ENG"
        },
        {
            "CultureCode": "0x0409",
            "DisplayName": "English - United States",
            "LanguageCultureName": "en-US",
            "iso_639x_value": "ENU"
        },
        {
            "CultureCode": "0x3009",
            "DisplayName": "English - Zimbabwe",
            "LanguageCultureName": "en-ZW",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0425",
            "DisplayName": "Estonian - Estonia",
            "LanguageCultureName": "et-EE",
            "iso_639x_value": "ETI"
        },
        {
            "CultureCode": "0x0438",
            "DisplayName": "Faroese - Faroe Islands",
            "LanguageCultureName": "fo-FO",
            "iso_639x_value": "FOS"
        },
        {
            "CultureCode": "0x0429",
            "DisplayName": "Farsi - Iran",
            "LanguageCultureName": "fa-IR",
            "iso_639x_value": "FAR"
        },
        {
            "CultureCode": "0x040B",
            "DisplayName": "Finnish - Finland",
            "LanguageCultureName": "fi-FI",
            "iso_639x_value": "FIN"
        },
        {
            "CultureCode": "0x080C",
            "DisplayName": "French - Belgium",
            "LanguageCultureName": "fr-BE",
            "iso_639x_value": "FRB"
        },
        {
            "CultureCode": "0x0C0C",
            "DisplayName": "French - Canada",
            "LanguageCultureName": "fr-CA",
            "iso_639x_value": "FRC"
        },
        {
            "CultureCode": "0x040C",
            "DisplayName": "French - France",
            "LanguageCultureName": "fr-FR",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x140C",
            "DisplayName": "French - Luxembourg",
            "LanguageCultureName": "fr-LU",
            "iso_639x_value": "FRL"
        },
        {
            "CultureCode": "0x180C",
            "DisplayName": "French - Monaco",
            "LanguageCultureName": "fr-MC",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x100C",
            "DisplayName": "French - Switzerland",
            "LanguageCultureName": "fr-CH",
            "iso_639x_value": "FRS"
        },
        {
            "CultureCode": "0x0456",
            "DisplayName": "Galician - Galician",
            "LanguageCultureName": "gl-ES",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0437",
            "DisplayName": "Georgian - Georgia",
            "LanguageCultureName": "ka-GE",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0C07",
            "DisplayName": "German - Austria",
            "LanguageCultureName": "de-AT",
            "iso_639x_value": "DEA"
        },
        {
            "CultureCode": "0x0407",
            "DisplayName": "German - Germany",
            "LanguageCultureName": "de-DE",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x1407",
            "DisplayName": "German - Liechtenstein",
            "LanguageCultureName": "de-LI",
            "iso_639x_value": "DEC"
        },
        {
            "CultureCode": "0x1007",
            "DisplayName": "German - Luxembourg",
            "LanguageCultureName": "de-LU",
            "iso_639x_value": "DEL"
        },
        {
            "CultureCode": "0x0807",
            "DisplayName": "German - Switzerland",
            "LanguageCultureName": "de-CH",
            "iso_639x_value": "DES"
        },
        {
            "CultureCode": "0x0408",
            "DisplayName": "Greek - Greece",
            "LanguageCultureName": "el-GR",
            "iso_639x_value": "ELL"
        },
        {
            "CultureCode": "0x0447",
            "DisplayName": "Gujarati - India",
            "LanguageCultureName": "gu-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x040D",
            "DisplayName": "Hebrew - Israel",
            "LanguageCultureName": "he-IL",
            "iso_639x_value": "HEB"
        },
        {
            "CultureCode": "0x0439",
            "DisplayName": "Hindi - India",
            "LanguageCultureName": "hi-IN",
            "iso_639x_value": "HIN"
        },
        {
            "CultureCode": "0x040E",
            "DisplayName": "Hungarian - Hungary",
            "LanguageCultureName": "hu-HU",
            "iso_639x_value": "HUN"
        },
        {
            "CultureCode": "0x040F",
            "DisplayName": "Icelandic - Iceland",
            "LanguageCultureName": "is-IS",
            "iso_639x_value": "ISL"
        },
        {
            "CultureCode": "0x0421",
            "DisplayName": "Indonesian - Indonesia",
            "LanguageCultureName": "id-ID",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0410",
            "DisplayName": "Italian - Italy",
            "LanguageCultureName": "it-IT",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0810",
            "DisplayName": "Italian - Switzerland",
            "LanguageCultureName": "it-CH",
            "iso_639x_value": "ITS"
        },
        {
            "CultureCode": "0x0411",
            "DisplayName": "Japanese - Japan",
            "LanguageCultureName": "ja-JP",
            "iso_639x_value": "JPN"
        },
        {
            "CultureCode": "0x044B",
            "DisplayName": "Kannada - India",
            "LanguageCultureName": "kn-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x043F",
            "DisplayName": "Kazakh - Kazakhstan",
            "LanguageCultureName": "kk-KZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0457",
            "DisplayName": "Konkani - India",
            "LanguageCultureName": "kok-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0412",
            "DisplayName": "Korean - Korea",
            "LanguageCultureName": "ko-KR",
            "iso_639x_value": "KOR"
        },
        {
            "CultureCode": "0x0440",
            "DisplayName": "Kyrgyz - Kazakhstan",
            "LanguageCultureName": "ky-KZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0426",
            "DisplayName": "Latvian - Latvia",
            "LanguageCultureName": "lv-LV",
            "iso_639x_value": "LVI"
        },
        {
            "CultureCode": "0x0427",
            "DisplayName": "Lithuanian - Lithuania",
            "LanguageCultureName": "lt-LT",
            "iso_639x_value": "LTH"
        },
        {
            "CultureCode": "0x042F",
            "DisplayName": "Macedonian (FYROM)",
            "LanguageCultureName": "mk-MK",
            "iso_639x_value": "MKD"
        },
        {
            "CultureCode": "0x083E",
            "DisplayName": "Malay - Brunei",
            "LanguageCultureName": "ms-BN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x043E",
            "DisplayName": "Malay - Malaysia",
            "LanguageCultureName": "ms-MY",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x044E",
            "DisplayName": "Marathi - India",
            "LanguageCultureName": "mr-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0450",
            "DisplayName": "Mongolian - Mongolia",
            "LanguageCultureName": "mn-MN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0414",
            "DisplayName": "Norwegian (Bokm?l) - Norway",
            "LanguageCultureName": "nb-NO",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0814",
            "DisplayName": "Norwegian (Nynorsk) - Norway",
            "LanguageCultureName": "nn-NO",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0415",
            "DisplayName": "Polish - Poland",
            "LanguageCultureName": "pl-PL",
            "iso_639x_value": "PLK"
        },
        {
            "CultureCode": "0x0416",
            "DisplayName": "Portuguese - Brazil",
            "LanguageCultureName": "pt-BR",
            "iso_639x_value": "PTB"
        },
        {
            "CultureCode": "0x0816",
            "DisplayName": "Portuguese - Portugal",
            "LanguageCultureName": "pt-PT",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0446",
            "DisplayName": "Punjabi - India",
            "LanguageCultureName": "pa-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0418",
            "DisplayName": "Romanian - Romania",
            "LanguageCultureName": "ro-RO",
            "iso_639x_value": "ROM"
        },
        {
            "CultureCode": "0x0419",
            "DisplayName": "Russian - Russia",
            "LanguageCultureName": "ru-RU",
            "iso_639x_value": "RUS"
        },
        {
            "CultureCode": "0x044F",
            "DisplayName": "Sanskrit - India",
            "LanguageCultureName": "sa-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0C1A",
            "DisplayName": "Serbian (Cyrillic) - Serbia",
            "LanguageCultureName": "Cy-sr-SP",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x081A",
            "DisplayName": "Serbian (Latin) - Serbia",
            "LanguageCultureName": "Lt-sr-SP",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x041B",
            "DisplayName": "Slovak - Slovakia",
            "LanguageCultureName": "sk-SK",
            "iso_639x_value": "SKY"
        },
        {
            "CultureCode": "0x0424",
            "DisplayName": "Slovenian - Slovenia",
            "LanguageCultureName": "sl-SI",
            "iso_639x_value": "SLV"
        },
        {
            "CultureCode": "0x2C0A",
            "DisplayName": "Spanish - Argentina",
            "LanguageCultureName": "es-AR",
            "iso_639x_value": "ESS"
        },
        {
            "CultureCode": "0x400A",
            "DisplayName": "Spanish - Bolivia",
            "LanguageCultureName": "es-BO",
            "iso_639x_value": "ESB"
        },
        {
            "CultureCode": "0x340A",
            "DisplayName": "Spanish - Chile",
            "LanguageCultureName": "es-CL",
            "iso_639x_value": "ESL"
        },
        {
            "CultureCode": "0x240A",
            "DisplayName": "Spanish - Colombia",
            "LanguageCultureName": "es-CO",
            "iso_639x_value": "ESO"
        },
        {
            "CultureCode": "0x140A",
            "DisplayName": "Spanish - Costa Rica",
            "LanguageCultureName": "es-CR",
            "iso_639x_value": "ESC"
        },
        {
            "CultureCode": "0x1C0A",
            "DisplayName": "Spanish - Dominican Republic",
            "LanguageCultureName": "es-DO",
            "iso_639x_value": "ESD"
        },
        {
            "CultureCode": "0x300A",
            "DisplayName": "Spanish - Ecuador",
            "LanguageCultureName": "es-EC",
            "iso_639x_value": "ESF"
        },
        {
            "CultureCode": "0x440A",
            "DisplayName": "Spanish - El Salvador",
            "LanguageCultureName": "es-SV",
            "iso_639x_value": "ESE"
        },
        {
            "CultureCode": "0x100A",
            "DisplayName": "Spanish - Guatemala",
            "LanguageCultureName": "es-GT",
            "iso_639x_value": "ESG"
        },
        {
            "CultureCode": "0x480A",
            "DisplayName": "Spanish - Honduras",
            "LanguageCultureName": "es-HN",
            "iso_639x_value": "ESH"
        },
        {
            "CultureCode": "0x080A",
            "DisplayName": "Spanish - Mexico",
            "LanguageCultureName": "es-MX",
            "iso_639x_value": "ESM"
        },
        {
            "CultureCode": "0x4C0A",
            "DisplayName": "Spanish - Nicaragua",
            "LanguageCultureName": "es-NI",
            "iso_639x_value": "ESI"
        },
        {
            "CultureCode": "0x180A",
            "DisplayName": "Spanish - Panama",
            "LanguageCultureName": "es-PA",
            "iso_639x_value": "ESA"
        },
        {
            "CultureCode": "0x3C0A",
            "DisplayName": "Spanish - Paraguay",
            "LanguageCultureName": "es-PY",
            "iso_639x_value": "ESZ"
        },
        {
            "CultureCode": "0x280A",
            "DisplayName": "Spanish - Peru",
            "LanguageCultureName": "es-PE",
            "iso_639x_value": "ESR"
        },
        {
            "CultureCode": "0x500A",
            "DisplayName": "Spanish - Puerto Rico",
            "LanguageCultureName": "es-PR",
            "iso_639x_value": "ES"
        },
        {
            "CultureCode": "0x0C0A",
            "DisplayName": "Spanish - Spain",
            "LanguageCultureName": "es-ES",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x380A",
            "DisplayName": "Spanish - Uruguay",
            "LanguageCultureName": "es-UY",
            "iso_639x_value": "ESY"
        },
        {
            "CultureCode": "0x200A",
            "DisplayName": "Spanish - Venezuela",
            "LanguageCultureName": "es-VE",
            "iso_639x_value": "ESV"
        },
        {
            "CultureCode": "0x0441",
            "DisplayName": "Swahili - Kenya",
            "LanguageCultureName": "sw-KE",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x081D",
            "DisplayName": "Swedish - Finland",
            "LanguageCultureName": "sv-FI",
            "iso_639x_value": "SVF"
        },
        {
            "CultureCode": "0x041D",
            "DisplayName": "Swedish - Sweden",
            "LanguageCultureName": "sv-SE",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x045A",
            "DisplayName": "Syriac - Syria",
            "LanguageCultureName": "syr-SY",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0449",
            "DisplayName": "Tamil - India",
            "LanguageCultureName": "ta-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0444",
            "DisplayName": "Tatar - Russia",
            "LanguageCultureName": "tt-RU",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x044A",
            "DisplayName": "Telugu - India",
            "LanguageCultureName": "te-IN",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x041E",
            "DisplayName": "Thai - Thailand",
            "LanguageCultureName": "th-TH",
            "iso_639x_value": "THA"
        },
        {
            "CultureCode": "0x041F",
            "DisplayName": "Turkish - Turkey",
            "LanguageCultureName": "tr-TR",
            "iso_639x_value": "TRK"
        },
        {
            "CultureCode": "0x0422",
            "DisplayName": "Ukrainian - Ukraine",
            "LanguageCultureName": "uk-UA",
            "iso_639x_value": "UKR"
        },
        {
            "CultureCode": "0x0420",
            "DisplayName": "Urdu - Pakistan",
            "LanguageCultureName": "ur-PK",
            "iso_639x_value": "URD"
        },
        {
            "CultureCode": "0x0843",
            "DisplayName": "Uzbek (Cyrillic) - Uzbekistan",
            "LanguageCultureName": "Cy-uz-UZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x0443",
            "DisplayName": "Uzbek (Latin) - Uzbekistan",
            "LanguageCultureName": "Lt-uz-UZ",
            "iso_639x_value": ""
        },
        {
            "CultureCode": "0x042A",
            "DisplayName": "Vietnamese - Vietnam",
            "LanguageCultureName": "vi-VN",
            "iso_639x_value": "VIT"
        }
    ];

    var PreferredUILanguages;
    var linux_language;
    var win32_language;
    switch (node_process.platform) {
        case "linux":
            PreferredUILanguages = deepCopy(node_process.env.LANG);
            if (PreferredUILanguages !== undefined) {
                if (String(PreferredUILanguages).indexOf(".") >= 0) {
                    var tmp1 = deepCopy(String(String(PreferredUILanguages).split(".")[0]));
                    var tmp2 = new Array(...tmp1);
                    tmp2.forEach(function (value, index, array) {
                        if (String(value).indexOf("_") >= 0) {
                            array[index] = deepCopy("-");
                        }
                    });
                    linux_language = deepCopy(String(tmp2.join("")).toLowerCase());
                } else {
                    linux_language = "en-us";
                }
            } else {
                try {
                    PreferredUILanguages = child_process.execSync("localectl").toString("utf8");
                    linux_language = linux_ProgramResult(PreferredUILanguages, "localectl").lang;
                } catch (e1) {
                    try {
                        PreferredUILanguages = child_process.execSync("locale").toString("utf8");
                        linux_language = linux_ProgramResult(PreferredUILanguages, "locale").lang;
                    } catch (e2) {
                        linux_language = "en-us";
                    }
                }
            }
            return linux_language;
        case "win32":
            try {
                PreferredUILanguages = child_process.execSync(`reg query "HKCU\\Control Panel\\Desktop" /v PreferredUILanguages`).toString("utf8");
                win32_language = String(dataResultExtract(PreferredUILanguages).value).toLocaleLowerCase();
            } catch (e1) {
                try {
                    PreferredUILanguages = child_process.execSync(`reg query "HKCU\\Control Panel\\Desktop\\MuiCached" /v MachinePreferredUILanguages`).toString("utf8");
                    win32_language = String(dataResultExtract(PreferredUILanguages).value).toLocaleLowerCase();
                } catch (e2) {
                    try {
                        PreferredUILanguages = child_process.execSync(`reg query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language" /v InstallLanguage`).toString("utf8");
                        var lang_code = dataResultExtract(PreferredUILanguages).value;
                        win32_languageCode_Tables.forEach(function (value) {
                            if (String(value.CultureCode).indexOf(lang_code) >= 0) {
                                win32_language = String(value.LanguageCultureName).toLowerCase();
                            }
                        });
                    } catch (e3) {
                        win32_language = "en-us";
                    }
                }
            }
            return win32_language;
        default:
            throw new Error("Not Support This Operate System");
    }
}

/**
 * 获取当前操作系统简要信息
 *
 * @return Object
 * */
function getCurrentEnvironmentSimpleInfo() {
    var os_module = require("os");
    var child_process = require("child_process");
    var os_info = {
        computerName: os_module.hostname(),
        currentLoginUser: os_module.userInfo().username,
        currentLoginUserHomePath: os_module.homedir(),
        runtime_Total_memory: os_module.totalmem(),
        runtime_Free_memory: os_module.freemem(),
        central_Processing_Unit: {count: 0, names: [], list: []},
        operate_System: {
            os_name: "",
            os_version: "",
            os_platform: "",
            os_ownerName: "",
            os_organization: "",
            os_configuration: ""
        },
        network: {ipv4: [], ipv6: []}
    };

    function deepCopy(source) {
        var cp1;
        var cp2;
        try {
            cp1 = JSON.stringify(source);
            cp2 = JSON.parse(cp1);
            return cp2;
        } catch (e) {
            return source;
        }
    }

    function EraseMatchArrayItems(sourceArray, needEraseItem, notModifySourceArray) {
        if (typeof notModifySourceArray !== "boolean") {
            notModifySourceArray = false;
        }
        if (Object.prototype.toString.call(sourceArray) !== "[object Array]") {
            throw new Error("sourceArray Argument must be an array");
        }

        if (needEraseItem !== undefined) {
            var final = [];
            var stopLoop = false;
            while (true) {
                var funcResult = undefined;
                try {
                    sourceArray.forEach(function (value, index, array) {
                        switch (typeof needEraseItem) {
                            case "function":
                                if (Object.prototype.toString.call(needEraseItem) === "[object Function]") {
                                    funcResult = needEraseItem(value);
                                    if (funcResult !== undefined) {
                                        if (typeof funcResult === "boolean") {
                                            if (funcResult) {
                                                if (!notModifySourceArray) {
                                                    throw index;
                                                }
                                            } else {
                                                if (notModifySourceArray) {
                                                    final.push(deepCopy(value));
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    throw new Error("is Only Support Not Async Functions!");
                                }
                                break;
                            case "string":
                                if (String(needEraseItem).toString() === String(value).toString()) {
                                    if (!notModifySourceArray) {
                                        throw index;
                                    }
                                } else {
                                    if (notModifySourceArray) {
                                        final.push(deepCopy(value));
                                    }
                                }
                                break;
                            case "number":
                                if (Number(needEraseItem).valueOf() === Number(value).valueOf()) {
                                    if (!notModifySourceArray) {
                                        throw index;
                                    }
                                } else {
                                    if (notModifySourceArray) {
                                        final.push(deepCopy(value));
                                    }
                                }
                                break;
                            default:
                                throw new Error("needEraseItem is Only Support String Or Number Or Functions");
                        }
                    });
                    stopLoop = true;
                } catch (e) {
                    stopLoop = false;
                    sourceArray.splice(e, 1);
                }
                if (stopLoop) {
                    break;
                }
            }
            if (notModifySourceArray) {
                return final;
            } else {
                return undefined;
            }
        } else {
            throw new Error("not Exist need Match Item");
        }
    }

    function infoBody() {
        return {
            model: "",
            speed: "",
            core: 0
        }
    }

    function notEmptyChk(objectOrArray) {
        var count = 0;
        switch (Object.prototype.toString.call(objectOrArray)) {
            case "[object Object]":
                for (var item in objectOrArray) {
                    count++;
                    if (count > 0) {
                        break;
                    }
                }
                return count > 0;
            case "[object Array]":
                count = objectOrArray.length;
                return count > 0;
            default:
                throw new Error("Param It Not Object And Not Array");
        }
    }

    var last_cpu_name = "";
    os_module.cpus().forEach(function (value, index, array) {
        var tmp1 = EraseMatchArrayItems(String(value.model).split(" "), "", true);
        if (String(tmp1.join(" ")).toString() === last_cpu_name) {
            os_info.central_Processing_Unit.list.forEach(function (value, index, array) {
                if (last_cpu_name === value.model) {
                    array[index].core++;
                }
            });
        } else {
            os_info.central_Processing_Unit.count++;
            os_info.central_Processing_Unit.names.push(tmp1.join(" "));
            var t1 = infoBody();
            last_cpu_name = deepCopy(tmp1.join(" "));
            t1.model = deepCopy(tmp1.join(" "));
            t1.core++;
            t1.speed = deepCopy(value.speed);
            os_info.central_Processing_Unit.list.push(t1);
        }
    });

    function p_loop(p1, p2) {
        if (p1.length > 0 && p2.length > 0 && p1.length === p2.length) {
            var pos = 0;
            var end = p1.length;
            while (true) {
                if (pos >= end) {
                    break;
                }
                if (typeof os_module[deepCopy(p2[pos])] === "function") {
                    os_info.operate_System[deepCopy(p1[pos])] = deepCopy(os_module[deepCopy(p2[pos])]());
                }
                pos++;
            }
        } else {
            throw new Error("throw");
        }
    }

    function str_arr(str_source) {
        var final_convert = [];
        if (typeof str_source === "string") {
            for (var str_num = 0; str_num < String(str_source).length; str_num++) {
                final_convert.push(String(str_source).charAt(str_num));
            }
        } else {
            throw new Error("not need converts strings");
        }
        return final_convert;
    }

    var info_p_list;
    var os_p_list;
    switch (os_module.platform()) {
        case "linux":
            info_p_list = ["os_platform", "os_arch", "os_type", "line_break"];
            os_p_list = ["platform", "arch", "type", "EOL"];
            p_loop(info_p_list, os_p_list);
            var extra_cmd = ["lsb_release -s -d", "lsb_release -s -r"];
            try {
                extra_cmd.forEach(function (value, index) {
                    var t_2;
                    var t_1 = child_process.execSync(value, {
                        encoding: "utf8",
                        windowsHide: true
                    });
                    t_2 = str_arr(t_1);
                    EraseMatchArrayItems(t_2, "\"");
                    EraseMatchArrayItems(t_2, "\n");
                    switch (index) {
                        case 0:
                            os_info.operate_System.os_name = deepCopy(t_2.join(""));
                            break;
                        case 1:
                            os_info.operate_System.os_version = deepCopy(t_2.join(""));
                            break;
                    }
                });
            } catch (e) {

            }
            break;
        case "win32":
            info_p_list = ["os_name", "os_platform", "os_version", "os_arch", "os_type", "line_break"];
            os_p_list = ["version", "platform", "release", "arch", "type", "EOL"];
            p_loop(info_p_list, os_p_list);
            try {
                var originInfo = child_process.execSync("chcp 65001 && systeminfo", {
                    windowsHide: true,
                    encoding: "utf8"
                });
                var originInfo_split = String(originInfo).split(os_module.EOL);
                originInfo_split.shift();
                EraseMatchArrayItems(originInfo_split, "");
                originInfo_split.forEach(function (value, index, array) {
                    var tmp_x = String(value).split(":");
                    var p1_item;
                    var p1_value;
                    var cp_item;
                    var cp_value;
                    cp_item = String(deepCopy(tmp_x[0])).split(" ");
                    cp_value = String(deepCopy(tmp_x[1])).split(" ");
                    EraseMatchArrayItems(cp_item, "");
                    EraseMatchArrayItems(cp_value, "");
                    if (cp_item.length > 1) {
                        p1_item = deepCopy(cp_item.join("_"));
                    } else {
                        p1_item = deepCopy(cp_item.join(""));
                    }
                    if (cp_value.length > 1) {
                        p1_value = deepCopy(cp_value.join(" "));
                    } else {
                        p1_value = deepCopy(cp_value.join(""));
                    }
                    switch (String(p1_item).toLowerCase()) {
                        case "os_name":
                            os_info.operate_System.os_name = deepCopy(p1_value);
                            break;
                        case "os_version":
                            os_info.operate_System.os_version = deepCopy(p1_value);
                            break;
                        case "registered_owner":
                            os_info.operate_System.os_ownerName = deepCopy(p1_value);
                            break;
                        case "registered_organization":
                            os_info.operate_System.os_organization = deepCopy(p1_value);
                            break;
                        case "os_configuration":
                            os_info.operate_System.os_configuration = deepCopy(p1_value);
                            break;
                    }
                });
            } catch (e) {

            }
            break;
    }
    if (typeof os_module.networkInterfaces === "function") {
        var origin_network = os_module.networkInterfaces();
        try {
            if (notEmptyChk(origin_network)) {
                for (var item in origin_network) {
                    origin_network[item].forEach(function (value, index, array) {
                        switch (String(value.family).toLowerCase()) {
                            case "ipv4":
                                os_info.network.ipv4.push(deepCopy(value));
                                break;
                            case "ipv6":
                                os_info.network.ipv6.push(deepCopy(value));
                                break;
                        }
                    });
                }
            }
        } catch (e) {

        }
    }
    return os_info;
}

module.exports = {
    nodeModulePluginsObjectBuilder,
    getCusFmtTimeDate,
    getCustomFormatTimeDate,
    getCurrentHostName,
    getCurrentHostIPAddress,
    getCurrentDisplayLanguage,
    getAllStorageDevice,
    getCurrentEnvironmentSimpleInfo,
    RuntimeMemoryInfo,
    portRange,
    hostCheck,
    isExecProgramDetect
};